﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DiarioSur.Codigo;

namespace DiarioSur
{
    public partial class Noticia : FormGenerico
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["not"] == null)
                return;

            int idNoticia = int.Parse(Request.QueryString["not"].ToString());
            DiarioSurDataContext contexto = new DiarioSurDataContext();
            DS_Noticia noticia = contexto.DS_Noticias.Where(n => n.IdNoticia == idNoticia && n.Habilitada == true).FirstOrDefault();
            titulo.InnerText = noticia.Titulo;
            descripcion.InnerText = noticia.Descripcion;

            if (!IsPostBack)
                RegistrarAcceso();
        }
    }
}